import request from '../utils/request'

//提供用于登录的函数
export const userLoginService = (loginData)=>{
    const param = new URLSearchParams();
    for(let key in loginData){
        param.append(key, loginData[key]);
    }

    return request.post('/smartmeeting/user/login', param)
}

export const userRegisterService = (registerData)=>{
    const param  = new URLSearchParams();
    console.log(param)
    for(let key in registerData){
        param.append(key, registerData[key]);
    }
    return request.post('/smartmeeting/user/register', param);

    // // 直接将 registerData 转换为 JSON
    // console.log(registerData);
    // return request.post('/smartmeeting/user/register', registerData, {
    //     headers: {
    //         'Content-Type': 'application/json'
    //     }
    // });
}
